//
//  CMCollectionViewController.m
//  CraneMachine
//
//  Created by ice on 2017/10/30.
//  Copyright © 2017年 ICE. All rights reserved.
//

#import "CMCollectionViewController.h"
#import "MJRefresh.h"

@interface CMCollectionViewController ()

@end

@implementation CMCollectionViewController

static NSString * const reuseIdentifier = @"Cell";

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Register cell classes
    [self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:reuseIdentifier];
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)addHeaderRefreshViewInView:(UIScrollView *)view actionBlock:(void(^)())block {
    MJRefreshNormalHeader *temp = [MJRefreshNormalHeader headerWithRefreshingBlock:block];
    temp.lastUpdatedTimeLabel.hidden = YES;
    view.mj_header = temp;
}

- (void)addFooterRefreshViewInView:(UIScrollView *)view actionBlock:(void(^)())block {
    view.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:block];
    view.mj_footer.automaticallyHidden = YES;
}

- (void)endHeaderFooterAnimationInView:(UIScrollView *)view {
    [view.mj_footer endRefreshing];
    [view.mj_header endRefreshing];
}

@end
